
package sg.edu.nus.iss.cats.dataaccess.mysql;

import sg.edu.nus.iss.cats.dataaccess.*;
import java.sql.*;

public class UserRoleObjectHandler implements ObjectHandler {

    public String getTableName () {
        return DBConstants.userRolesTableName;
    }

    public String getKeyParameterConstraint () {
        return null;
    }

    public void setKeyParameters (PreparedStatement statement, Object obj)
                   throws SQLException, DAOException {
        throw new DAOException ("Method setKeyValues not implemented");
    }

    public Object retrieveObject (ResultSet results)
                   throws SQLException, DAOException  {
        return results.getString(DBConstants.ur_roleId);
    }

    public void insertKeys (ResultSet results, Object obj)
                   throws SQLException, DAOException {
        throw new DAOException ("Method insertKeys not implemented");
    }

    public void updateObject (ResultSet results, Object obj)
                   throws SQLException, DAOException {
        throw new DAOException ("Object update not valid for UserRole");
    }

    public void completeObjectRetrieve (Object obj) throws DAOException {
    }

    public Object[] getObjectArray (int length) {
        return new String [length];
    }
}